import java.util.*;
import java.util.regex.*;
import java.text.*;
import java.math.*;
import java.awt.geom.*;

public class WhichDay
{
	public String getDay(String[] notOnThisDay)
	{
		int sum = (1 + 7) * 7 / 2;
		for(String str : notOnThisDay){
			sum -= getNumber(str);
		}
		return getDays(sum);
	}
	
	public int getNumber(String s){
		if(s.compareTo("Sunday") == 0) return 7;
		if(s.compareTo("Saturday") == 0) return 6;
		if(s.compareTo("Friday") == 0) return 5;
		if(s.compareTo("Thursday") == 0) return 4;
		if(s.compareTo("Wednesday") == 0) return 3;
		if(s.compareTo("Tuesday") == 0) return 2;
		if(s.compareTo("Monday") == 0) return 1;
		return 0;
	}
	
	public String getDays(int n){
		if(n == 1) return "Monday";
		if(n == 2) return "Tuesday";
		if(n == 3) return "Wednesday";
		if(n == 4) return "Thursday";
		if(n == 5) return "Friday";
		if(n == 6) return "Saturday";
		if(n == 7) return "Sunday";
		return "None";
	}
	
	public static void main(String[] args)
	{
		long time;
		String answer;
		boolean errors = false;
		String desiredAnswer;
		
		
		time = System.currentTimeMillis();
		answer = new WhichDay().getDay(new String[]{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday"});
		System.out.println("Time: " + (System.currentTimeMillis()-time)/1000.0 + " seconds");
		desiredAnswer = "Saturday";
		System.out.println("Your answer:");
		System.out.println("\t\"" + answer + "\"");
		System.out.println("Desired answer:");
		System.out.println("\t\"" + desiredAnswer + "\"");
		if (!answer.equals(desiredAnswer))
		{
			errors = true;
			System.out.println("DOESN'T MATCH!!!!");
		}
		else
			System.out.println("Match :-)");
		System.out.println();
		time = System.currentTimeMillis();
		answer = new WhichDay().getDay(new String[]{"Sunday", "Monday", "Tuesday", "Wednesday", "Friday", "Thursday"});
		System.out.println("Time: " + (System.currentTimeMillis()-time)/1000.0 + " seconds");
		desiredAnswer = "Saturday";
		System.out.println("Your answer:");
		System.out.println("\t\"" + answer + "\"");
		System.out.println("Desired answer:");
		System.out.println("\t\"" + desiredAnswer + "\"");
		if (!answer.equals(desiredAnswer))
		{
			errors = true;
			System.out.println("DOESN'T MATCH!!!!");
		}
		else
			System.out.println("Match :-)");
		System.out.println();
		time = System.currentTimeMillis();
		answer = new WhichDay().getDay(new String[]{"Sunday", "Monday", "Tuesday", "Thursday", "Friday", "Saturday"});
		System.out.println("Time: " + (System.currentTimeMillis()-time)/1000.0 + " seconds");
		desiredAnswer = "Wednesday";
		System.out.println("Your answer:");
		System.out.println("\t\"" + answer + "\"");
		System.out.println("Desired answer:");
		System.out.println("\t\"" + desiredAnswer + "\"");
		if (!answer.equals(desiredAnswer))
		{
			errors = true;
			System.out.println("DOESN'T MATCH!!!!");
		}
		else
			System.out.println("Match :-)");
		System.out.println();
		time = System.currentTimeMillis();
		answer = new WhichDay().getDay(new String[]{"Sunday", "Friday", "Tuesday", "Wednesday", "Monday", "Saturday"});
		System.out.println("Time: " + (System.currentTimeMillis()-time)/1000.0 + " seconds");
		desiredAnswer = "Thursday";
		System.out.println("Your answer:");
		System.out.println("\t\"" + answer + "\"");
		System.out.println("Desired answer:");
		System.out.println("\t\"" + desiredAnswer + "\"");
		if (!answer.equals(desiredAnswer))
		{
			errors = true;
			System.out.println("DOESN'T MATCH!!!!");
		}
		else
			System.out.println("Match :-)");
		System.out.println();
		
		
		if (errors)
			System.out.println("Some of the test cases had errors :-(");
		else
			System.out.println("You're a stud (at least on the test data)! :-D ");
	}

}
//Powered by [KawigiEdit] 2.0!
